Please go to \hyperlink{error_8finc}{api/error.\+finc} for the A\+P\+I documentation.

The error handling subroutines are available from Fortran, with exception of the macros {\ttfamily G\+S\+L\+\_\+\+E\+R\+R\+O\+R} and {\ttfamily G\+S\+L\+\_\+\+E\+R\+R\+O\+R\+\_\+\+V\+A\+L}. A user-\/defined error handler can be defined either in C or using a Fortran function with the {\ttfamily bind(c)} attribute. Here is the description of the required interface\+: 
\begin{DoxyPre}
 subroutine errhand(reason, file, line, errno) bind(c)
    type(c\_ptr), value :: reason, file
    integer(c\_int), value :: line, errno
 end subroutine errhand
 \end{DoxyPre}
 An object of type {\ttfamily fgsl\+\_\+error\+\_\+handler\+\_\+t} is returned by the constructor {\ttfamily fgsl\+\_\+error\+\_\+handler\+\_\+init(errhand)}, which takes a subroutine with the interface described above as its argument. The subroutine {\ttfamily fgsl\+\_\+error(reason, file, line, errno)} works in an analogous manner as the C version. If the Fortran preprocessor is supported, it should be possible to use the macros {\ttfamily \+\_\+\+\_\+\+F\+I\+L\+E\+\_\+\+\_\+} and {\ttfamily \+\_\+\+\_\+\+L\+I\+N\+E\+\_\+\+\_\+} in the above call. Once not needed any more, the error handler object can be deallocated by calling the subroutine {\ttfamily fgsl\+\_\+error\+\_\+handler\+\_\+free} with itself as its only argument. Note that the function {\ttfamily fgsl\+\_\+strerror} returns a string of length {\ttfamily fgsl\+\_\+strmax}. 